﻿using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using BUS;
using Utility;

public partial class Admin_Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if( Session ["UserName"] !=null && Session ["Pass"]!=null )
            Response.Redirect("~/Admin/SanPhamList.aspx");
    }
    protected void btn_DangNhap_Click(object sender, EventArgs e)
    {

        string User = txt_TaiKhoan.Text;
        string Pass = txt_MatKhau.Text;
        if(tbNhanVienBUS .DangNhap  (User ,Pass ))
        {
            Session["UserName"] = User;
            Session["Pass"] = Pass;
            Response.Redirect("~/Admin/SanPhamList.aspx");
            //lb_Error.Text = "Dang nhap thanh cong";

        }
        else         
             lb_Error.Text = "Tên đăng nhập hoặc mật khẩu không đúng";
        
    }
}
